<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>demo</title>
	<style>
		
	</style>
</head>
<body>
	
</body>
	<script>

		arr=[49,28,24,23,98,88,49,57,67,22,99,49];

		for(var i=0;i<arr.length-1;i++){
			for(var j=arr.length-1;j>i;j--){
				if(arr[j]<arr[j-1]){
					arr[j]=[arr[j-1],arr[j-1]=arr[j]][0];
				}
			}

		}
		
		console.log(arr);

	</script>
		
</html>